UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1lDzyKa7isRG5na8VlOC/sJFogPXrDCJHFNdkp/rwcU='
WHERE
key_id = '8791785775fc8d26dd83269e9767b1ea508c1d255276572cb6072b27c4f585c0'
AND (
token = '1lDzyKa7isRG5na8VlOC/sJFogPXrDCJHFNdkp/rwcU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)