UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yggbvhw5VA3uBy5bgLzDZT36xSHu2sJ/oo0RLjtbqcI='
WHERE
key_id = 'd1b3a9a5152fe04b2291405169b502d46878d8c31c3a1d540cffc3c78d0b3117'
AND (
token = 'yggbvhw5VA3uBy5bgLzDZT36xSHu2sJ/oo0RLjtbqcI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)