UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hSyxrzqVhjy/YHuBpMEAjypnWZRY0mu3WNBai6VhPNg='
WHERE
key_id = '807ca5be9a879092efdc2fd973cbdf270e45bfefccb60ad55aa0fe80e4c89432'
AND (
token = 'hSyxrzqVhjy/YHuBpMEAjypnWZRY0mu3WNBai6VhPNg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)