UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '45JMMzqwX0ZKBS9QiZEgtozSrKErQh82L9BFSPmj68A='
WHERE
key_id = 'd6e606f24a72ceecc5208eb1a4f260ee13d3f002a503335fd7fc65cd76340c24'
AND (
token = '45JMMzqwX0ZKBS9QiZEgtozSrKErQh82L9BFSPmj68A='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)