UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'L1bGiPWfltTMmuRTcwCKERhByv66g2RcJ69cGXPuvEM=' 
WHERE 
  key_id = 'db4735c0471c78179703ffe4038960ea8c11a0edb1ba9627712f5f20a728b9a9' 
  AND (
    token = 'L1bGiPWfltTMmuRTcwCKERhByv66g2RcJ69cGXPuvEM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00059