UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qVYOV+Q+Cownk/WClvKx1E9dAXQ3Os2AJGNIdcmbdv4=' 
WHERE 
  key_id = 'b2199c3aae9bcdc028fc6d80827e76b2d19be526abb1a7038134c7e4c45d2278' 
  AND (
    token = 'qVYOV+Q+Cownk/WClvKx1E9dAXQ3Os2AJGNIdcmbdv4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034