UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BCKwskp0yrZYE3qvPBZ/HIm1samf//757hNemzL2nCI='
WHERE
key_id = '5242e251f2cda0b368b965507f93b51dfb300d2eabf8afdea1cbcb7b3ac048b1'
AND (
token = 'BCKwskp0yrZYE3qvPBZ/HIm1samf//757hNemzL2nCI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)