UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '26D1oZiQjcchYVyAwbg+j3nYiiyRpcW9n8LD+CarQ54='
WHERE
key_id = '5f9ecc0386c8d3175a1bcd4e0a208bed0467970efe0cbdcb807496fc6ed50154'
AND (
token = '26D1oZiQjcchYVyAwbg+j3nYiiyRpcW9n8LD+CarQ54='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)