UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JqZPZw5ngbXadeAaSNLafnCTyaOvXhrN5L/aQFijXF4=' 
WHERE 
  key_id = 'ea7bfed02bc8c71aa0ab96c7165bf490dede3a4963935f7bd9d07134f43ad48c' 
  AND (
    token = 'JqZPZw5ngbXadeAaSNLafnCTyaOvXhrN5L/aQFijXF4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019