UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/alv1qZfDJx965Go9tIz4TEqNq+cM90p3NB7VKMb2ow=' 
WHERE 
  key_id = 'a1c25f03574eed7927e983747fae6c9d07d80cffb34ac41058fcf5569237207b' 
  AND (
    token = '/alv1qZfDJx965Go9tIz4TEqNq+cM90p3NB7VKMb2ow=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033