UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Rx4qP+/RKWfh4Eyvcfppb+KpnzAGZTC4/Da49L7gqfk='
WHERE
key_id = 'a800237cfc507860c70b8cf54602f21c3c83908eafae2875967577218f0a003f'
AND (
token = 'Rx4qP+/RKWfh4Eyvcfppb+KpnzAGZTC4/Da49L7gqfk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)