UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'w6hakZUL5/xM6aOs/EvyCzfZW8oF79KjeLPR/qRut8g=' 
WHERE 
  key_id = '55e1232938cefa91085aa2c1c447bdfbe979bfb090aa6c29e8e58844b1e46eac' 
  AND (
    token = 'w6hakZUL5/xM6aOs/EvyCzfZW8oF79KjeLPR/qRut8g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021