UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5JhipZsFRcqEt6z8u3k1YyzNQIZiY6Va/XazZNQyPNY=' 
WHERE 
  key_id = 'cb5032eb34a5b1fcc9b205234edfe682e9c0325181a64df98dcbf44bf7fc8fc5' 
  AND (
    token = '5JhipZsFRcqEt6z8u3k1YyzNQIZiY6Va/XazZNQyPNY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038