UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Gg3+P1/78Nb0sn4ops3IORQz4lh0us2GNvrQUQAkT5A='
WHERE
key_id = '833187c05ce406a50ed19296a5bb8248a0d12c8f8e056893b3a95891b8c66f35'
AND (
token = 'Gg3+P1/78Nb0sn4ops3IORQz4lh0us2GNvrQUQAkT5A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)