UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Oy4ifSPd3QmSZa18rPywtg574mOCJ+O4lrp6eo169+4='
WHERE
key_id = 'c26e612c55cab71fa1294dc1f03920191019043684186d86a2635b5aa76fd211'
AND (
token = 'Oy4ifSPd3QmSZa18rPywtg574mOCJ+O4lrp6eo169+4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)