UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'zZsA0nTbZo6byI+HHiq67yUP7xYq61/rmFtl8nY3ki4=' 
WHERE 
  key_id = '6fa45703e2768077e53528f67c3fc8225d7e9d11d2eefd4a314a29e83b8ea89c' 
  AND (
    token = 'zZsA0nTbZo6byI+HHiq67yUP7xYq61/rmFtl8nY3ki4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017