UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'V1HynxsTWF6AohJiGT6CgIdEDQn6wSV8RnJI9nvr+GM='
WHERE
key_id = '523ae421902bf0e0846a055015a889b3886d618b409814bd8ef19103f86332b1'
AND (
token = 'V1HynxsTWF6AohJiGT6CgIdEDQn6wSV8RnJI9nvr+GM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)