UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VxNOHGi2ycFPchJriF5/8ZbC8SfAFDGhpPYq4TLbyJA='
WHERE
key_id = '9c57b1afd0c6e908789c9f0951c306683e50ed0a7873026c4c1fe2be7d91ddfc'
AND (
token = 'VxNOHGi2ycFPchJriF5/8ZbC8SfAFDGhpPYq4TLbyJA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)