UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qyeMId1Fp89RS14sbblP467zcLtOugbr4Q6c4IFZCK0=' 
WHERE 
  key_id = '78b7502a1c1bfe30ff211f09dba90c44148ae2d367becf7baa3625bcc2366f67' 
  AND (
    token = 'qyeMId1Fp89RS14sbblP467zcLtOugbr4Q6c4IFZCK0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024