UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UCtYJvKGNpb8B4Bo/DdR1gzJWHolhzR04nDmu7ldikM='
WHERE
key_id = 'dd712c1d4be2f784d7a2ac031f5d0152465fd0955648d125d14fdb5c080c0493'
AND (
token = 'UCtYJvKGNpb8B4Bo/DdR1gzJWHolhzR04nDmu7ldikM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)