UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3trdhlKslhmVHTsxpbFS3WcdntdpVqmgzMe7HXufhKo='
WHERE
key_id = 'a1121221d26357ca1e896b982c90ae9044020030334495ac12cd5d82bd6c50dd'
AND (
token = '3trdhlKslhmVHTsxpbFS3WcdntdpVqmgzMe7HXufhKo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)