UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0npMZu4K/+z3XnvbtdJY8Tbgqb4bpMfpB9qs1gnJTQI='
WHERE
key_id = '4731b0d7a41bd03596e494bc69a1a2cf36d269e8062a1ef065c7487af86272cd'
AND (
token = '0npMZu4K/+z3XnvbtdJY8Tbgqb4bpMfpB9qs1gnJTQI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)