UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'KmAP8Lf6EmA0KQKgsZ7/e6gonEFZYGOq5tijuSWNbNg=' 
WHERE 
  key_id = 'f6324dd841389a5109dfe3a977a4e0deebf93a466dcd202d01575ab8d27d75c3' 
  AND (
    token = 'KmAP8Lf6EmA0KQKgsZ7/e6gonEFZYGOq5tijuSWNbNg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015