UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '99g1/vcTleonySOPkFFjgeyXQDJpqo659/bJr9Zwkqk='
WHERE
key_id = '78927d202149eee402c810b1f7753ef8d26d252c65f9a588edf87e4fcd0af0ee'
AND (
token = '99g1/vcTleonySOPkFFjgeyXQDJpqo659/bJr9Zwkqk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)