UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MvMP6RfzW0TCk+nqwiyp1N5Wt4+W9BiMLzvfZ3LdzWI='
WHERE
key_id = '5e6596e13c8dfa4898fa8121cd01a547d5a6746202d536c69d87266d390d66ac'
AND (
token = 'MvMP6RfzW0TCk+nqwiyp1N5Wt4+W9BiMLzvfZ3LdzWI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)