UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Js1htFqG+jz93LKulgFxG/8UhlhVu+dc/lrAm0IgBUE='
WHERE
key_id = '8dcd13b4d4fce0480ba293997032d9c5c3e499584dbd0137fd19bbfacb0056d7'
AND (
token = 'Js1htFqG+jz93LKulgFxG/8UhlhVu+dc/lrAm0IgBUE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)